package com.wanban.downloader.utils

import com.blankj.utilcode.util.ThreadUtils

object MyThreadUtils {
    
    fun <T> executeSingleTask(async: () -> T){
        ThreadUtils.executeBySingle(object: ThreadUtils.Task<T>(){
            override fun doInBackground(): T {
                return  async()
            }

            override fun onCancel() {
                
            }

            override fun onFail(t: Throwable?) {
                
            }

            override fun onSuccess(result: T) {
                
            }
        })
    }
    
}